#include "../syncup-service.h"
#include <stdio.h>

int main()
{
    RPC_STATUS st;

    st = RpcServerUseProtseqEpA((unsigned char *) SYNCUP_RPC_PROTO_SEQ,
            RPC_C_LISTEN_MAX_CALLS_DEFAULT,
            (unsigned char *) SYNCUP_RPC_EP, NULL);
    if (st) {
        exit(st);
    }
    st = RpcServerRegisterIf(syncup_service_v1_0_s_ifspec, NULL, NULL);
    if (st) {
        exit(st);
    }
    st = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, TRUE);
    if (st) {
        exit(st);
    }

    puts("Press enter to exit...");
    getchar();

    st = RpcServerUnregisterIf(syncup_service_v1_0_s_ifspec, NULL, TRUE);
    if (st) {
        exit(st);
    }
    puts("Successfully unregistered");
    return 0;
}
